import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/Main.vue'
import Login from '../views/Login.vue'
import OrderList from '../views/OrderList.vue'
import OrderAdd from '../views/OrderAdd.vue'
import OrderStat from '../views/OrderStat.vue'
import ClientDetails from '../views/ClientDetails.vue'
import RefundDetails from '../views/RefundDetails.vue'
import ClientUpdate from '../views/ClientUpdate.vue'
import SupplierList from '../views/SupplierList.vue'
import ProductionOrder from '../views/ProductionOrder.vue'
import ProductionReceive from '../views/ProductionReceive.vue'
import ProductionProduced from '../views/ProductionProduced.vue'
import ProductionOver from '../views/ProductionOver.vue'
import ProductionStore from '../views/ProductionStore.vue'
import ClientList from '../views/ClientList.vue'
import GoodsDetails from '../views/GoodsDetails.vue'
import PurorderList from '../views/PurorderList.vue'
import PurpayList from '../views/PurpayList.vue'
import PurstorageList from '../views/PurstorageList.vue'
import PurinvoiceList from '../views/PurinvoiceList.vue'
import PurorderdetailList from '../views/PurorderdetailList.vue'
import OutloadGoods from '../views/OutloadGoods.vue'

import UnloadGoods from '../views/UnloadGoods.vue'
import Goods from '../views/Goods.vue'
Vue.use(VueRouter)

const routes = [
  //配置默认路由
  {
    path: '/',
    redirect: '/main'
  },
  {
    path: '/main',
    name: '/main',
    component: Main,
    //配置嵌套路由
    children: [
      //供应商信息界面
      {
        path: '/orderStat',
        name: '/orderStat',
        component: OrderStat
      },
      {
        path: '/supplierList',
        name: '/supplierList',
        component: SupplierList
      },
      //采购订单界面
      {
        path: '/purorderList',
        name: '/purorderList',
        component: PurorderList
      },
      //采购入库界面
      {
        path: '/purstorageList',
        name: '/purstorageList',
        component: PurstorageList
      },
      //采购付款界面
      {
        path: '/purpayList',
        name: '/purpayList',
        component: PurpayList
      },
      //采购发票界面
      {
        path: '/purinvoiceList',
        name: '/purinvoiceList',
        component: PurinvoiceList
      },
      //采购明细界面
      {
        path: '/purorderdetailList',
        name: '/purorderdetailList',
        component: PurorderdetailList
      },
      
      {
        path: '/orderList',
        name: '/orderList',
        component: OrderList
      },
      {
        path: '/clientDetails',
        name: '/clientDetails',
        component: ClientDetails
      },
      {
        path: '/clientList',
        name: '/clientList',
        component: ClientList
      },
      {
        path: '/orderAdd',
        name: '/orderAdd',
        component: OrderAdd
      },
      //  生产单
      {
        path: '/productionorder',
        name: '/productionorder',
        component: ProductionOrder
      },
      //  生产领料
      {
        path: '/productionreceive',
        name: '/productionreceive',
        component: ProductionReceive
      },
      //  开始生产
      {
        path: '/productionproduced',
        name: '/productionproduced',
        component: ProductionProduced
      },
      //  结束生产
      {
        path: '/productionover',
        name: '/productionover',
        component: ProductionOver
      },
      //  生产仓储
      {
        path: '/productionstore',
        name: '/productionstore',
        component: ProductionStore
      },
      {
        path: '/clientDetails',
        name: '/clientDetails',
        component: ClientDetails
      },{
        path: '/unloadGoods',
        name: 'unloadGoods',
        component: UnloadGoods
      },
      {
        path: '/refundDetails',
        name: '/refundDetails',
        component: RefundDetails
      },
      {
        path: '/clientUpdate',
        name: '/clientUpdate',
        component: ClientUpdate
      },
      {
        path: '/goodsDetails',
        name: '/goodsDetails',
        component: GoodsDetails
      },
      {
        path: '/goods',
        name: 'goods',
        component: Goods
      },
      {
        path: '/outloadGoods',
        name: 'outloadGoods',
        component: OutloadGoods
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
